<template>
  <div class="home" style="width: 100%;height:100%;">
    <Dingbu :nameTitle="PageName"></Dingbu>
    <div class="content">
        <div class="search" style="margin-left:8px;">
          <Input v-model="value1" style="width:305px;" size="large" placeholder="请输入用户手机号"></Input>
          <Button type="success">搜索</Button>
        </div>
        <div class="content_table">
          <Table size="large" :columns="columns1" :data="data1"></Table>
          <Page style="float:right;margin:8px 15px 0 0;" :total="10" show-elevator></Page>
        </div>
    </div>
  </div>
</template>
<script>
import Dingbu from "../header/dingbu.vue";
import { mapGetters, mapMutations, mapActions } from "vuex";
import Base from "../../common/Base";
export default {
  mixins: [Base],
  data() {
    return {
      PageName: "用户列表",
      value1: "",
      columns1: [
        {
          title: "用户昵称",
          align: "center",
          key: "name"
        },
        {
          title: "用户头像",
          align: "center",
          key: "avatar",
          render: (h, params) => {
            return h("div", [
              h("img", {
                style: {
                  marginRight: "5px",
                  marginTop: "5px",
                  width: "63px",
                  cursor: "pointer"
                },
                attrs: {
                  src: params.row.avatar
                },
                on: {
                  click: () => {
                    this.loadImg(params.row.avatar);
                  }
                }
              })
            ]);
          }
        },
        {
          title: "消费总金额(￥)",
          align: "center",
          key: "age"
        },
        {
          title: "下单次数",
          align: "center",
          key: "address"
        },
        // {
        //   title: "首次登录联盟商家时间",
        //   align: "center",
        //   width: 178,
        //   key: "age"
        // },
        // {
        //   title: "上次登录联盟商家时间",
        //   align: "center",
        //   width: 178,
        //   key: "age"
        // },
        {
          title: "操作",
          align: "center",
          key: "address",
          render: (h, params) => {
            return h("div", [
              h(
                "Button",
                {
                  props: {
                    type: "success",
                    size: "small"
                  },
                  on: {
                    click: () => {
                      this.$router.push({
                        name: "userDetail",
                        params: { id: 1 },
                        // query: {id: 1}
                      });
                    }
                  }
                },
                "查看"
              )
            ]);
          }
        }
      ],
      data1: [{}]
    };
  },
  mounted() {},
  components: {
    Dingbu
  },
  methods: {}
};
</script>
<style lang="scss" scoped>
@import "../../css/common.scss";
.content {
  width: 100%;
  margin: 20px auto;
  > .content_table {
    margin-top: 20px;
  }
}
</style>

